package com.md.drcs.dicom.service.impl;

import com.md.drcs.dicom.dao.ReportDao;
import com.md.drcs.dicom.entity.ReportEntity;
import com.md.drcs.dicom.service.ReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("reportService")
public class ReportServiceImpl implements ReportService {

    @Autowired
    private ReportDao reportDao;

    @Override
    public boolean isReportAudited(Long studyId) {
        ReportEntity report = reportDao.findByStudyId(studyId);
        return report != null && report.getAudDate() != null;
    }

    @Override
    public ReportEntity findByStudyId(Long studyId) {
        return reportDao.findByStudyId(studyId);
    }

    @Override
    public List<ReportEntity> findByStudyIds(List<Long> studyIds) {
        return reportDao.findByStudyIds(studyIds);
    }

}
